<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/templates/template_admin.xhtml">
        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h1><h:outputText value="Edit Account"/></h1>
                <h:panelGrid columns="2">                   
                    <h:outputLabel value="Username" for="userName" />
                    <h:inputText id="userName" value="#{acmb.ac.userName}"  validator="#{vlmb.validatespecialcharacters}" title="" required="true" requiredMessage="You must enter Usename"/>
                    <h:outputLabel value="Password" for="password" />
                    <h:inputSecret id="password" value="#{acmb.ac.password}"  validator="#{vlmb.validatespecialcharacters}" title="" required="true" requiredMessage="You must enter password"/>
                    <h:outputLabel value="isChangedPassword" for="isChangedPassword" />
                    <h:selectOneMenu id="isChangedPassword" value="#{acmb.ac.isChangedPassword}" title="" required="true" >
                        <f:selectItem itemLabel="Yes" itemValue="#{true}"/>
                        <f:selectItem itemLabel="No" itemValue="#{false}" />
                    </h:selectOneMenu>
                    <h:outputLabel value="Role" for="role" />
                    <h:selectOneMenu id="role" value="#{acmb.ac.role}" title="" required="true" >
                        <f:selectItem itemLabel="Admin" itemValue="1"/>
                        <f:selectItem itemLabel="HR Group" itemValue="2" />
                        <f:selectItem itemLabel="Inter Viewer" itemValue="3" />
                    </h:selectOneMenu>
                    <h:outputLabel value="Employee ID" for="employeeID" />
                    <h:selectOneMenu id="employeeID" value="#{acmb.employeeID}">
                        <f:selectItems var="em" value="#{emb.employeeList()}" itemLabel="#{em.firstName} #{em.lastName}" itemValue="#{em.employeeID}"></f:selectItems>                        
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandButton action="#{acmb.editAccount()}" value="Update"/>
                <br />
                <h:link outcome="List" value="List" />
                <br />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
